<?php

namespace App\Http\Controllers\Admin;

use App\Setting;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class SettingController extends Controller
{
    private $settingManager;
    private $request;

    public function __construct (Request $request)
    {
        $this->settingManager = new Setting();
        $this->request = $request;
    }

    public function index(){
        return view('admin.setting.index',[
            'items' =>  $this->settingManager->getType()
        ]);
    }
    public function saveChange(){
        $post = $this->request->post();
        $this->settingManager->getRelCol($post);
        return redirect()->route('admin.setting')->with(
            $this->success()
        );
    }
}
